import request from '@/router/axios';


//PFMEA列表
export const getFmeaList = (params) => {
  return request({
    url: '/api/hg-public/fmea/page',
    method: 'get',
    params: {
      ...params,
    }
  })
}
// 获取最新的PFMEA
export const getNewestFmea = (params) => {
  return request({
    url: '/api/hg-public/fmea/getLastFmeaByProductId',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//查询阶段内最新审批过FMEA
export const getNewFmea = (params) => {
  return request({
    url: '/api/hg-public/fmea/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//更新 
export const updateFmea = (row) => {
  return request({
    url: '/api/hg-public/fmea/submit',
    method: 'post',
    data: row
  })
}

//删除 
export const removeFmea = (ids) => {
  return request({
    url: '/api/hg-public/fmea/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
//获取全部产品
export const getAllProduct = () => {
  return request({
    url: '/api/hg-public/fmea/listProduct',
    method: 'get',
  })
}
//提交
export const submitFmea = (fmeaId) => {
  return request({
    url: '/api/hg-public/fmea/start-process',
    method: 'get',
    params: {
      fmeaId,
    }
  })
}
//获取产品工序
export const getDetailProduct = (productId, fmeaId) => {
  return request({
    url: '/api/hg-public/fmea/getFmeaPlanDetail',
    method: 'get',
    params: {
      productId,
      fmeaId
    }
  })
}
// 获取责任人
export const getPersons = (params) => {
  return request({
    url: '/api/hg-public/prodplanlist/getPersons',
    method: 'get',
    params: {
      ...params
    }
  })
}